import Http from '@/http';

export function saveApi(params:any) {
    return params.id ? Http.put('chain/update/' + params.id, params) : Http.post('chain/add', params)
}

export function pageApi(params:any) {
    return Http.post('chain/page', params)
}

export function deleteApi(id) {
    return Http.delete('chain/delete/' + id)
}

export function uploadApi(file:File) {
    const formData = new FormData()
    formData.append('icon', file)
    return Http.post('chain/upload', formData)
}


export async function publicChainOptionsApi() {
    const r = await Http.get('chain/options')
    return r.data
}